package net.chrisrichardson.cloudtools.maven.plugins;

import net.chrisrichardson.ec2deployer.cluster.ClusterManager;
import net.chrisrichardson.ec2deployer.cluster.SimpleCluster;

/**
 * Goal for taking a snapshot of the database
 * @goal setmysqlrootpassword
 * @author cer
 *
 */
public class SetMySqlRootPasswordMojo extends AbstractClusterMojo {

  /**
   * password
   * 
   * @parameter expression="${cloudtools.mysql.root.password}" 
   * @required
   */
  protected String password;

  @Override
  protected void executeWithCluster(ClusterManager manager, SimpleCluster cluster) {
    cluster.setMySqlRootPassword(password);
    manager.saveCluster(getClusterName(), cluster);
  }

}
